package com.iceberg;

import java.awt.*;
import java.awt.geom.Ellipse2D;

public class AlgorithmVisualHelper {
    private AlgorithmVisualHelper(){}

    public static void setStrokeWidth(Graphics2D graphics2D, int width){
        graphics2D.setStroke(new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
    }

    public static void strokeCircle(Graphics2D graphics2D, int x, int y, int r){
        Ellipse2D circle = new Ellipse2D.Double(x - r, y - r, 2 * r, 2 * r);
        graphics2D.draw(circle);
    }

    public static void fillCircle(Graphics2D graphics2D, int x, int y, int r){
        Ellipse2D circle = new Ellipse2D.Double(x - r, y - r, 2 * r, 2 * r);
        graphics2D.fill(circle);
    }

    public static void setColor(Graphics2D graphics2D, Color color){
        graphics2D.setColor(color);
    }

    public static void pause(int time){
        try {
            Thread.sleep(time);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}
